<?php


namespace App\Http\Controllers\Business;


use App\Models\BaseModel;
use App\Models\Shop;
use Illuminate\Http\Request;

class ShopController extends BaseModel
{
    public function createShop(Request $request)
    {

        try {
            $data = [
                'business_id'=>$request->input('business_id'),
                'shop_name' => $request->input('shop_name'),
                'shop_tel' => $request->input('shop_tel'),
                'font_id_img' => $request->input('font_id_img'),
                'back_id_img' => $request->input('back_id_img'),
                'business_license_img' => $request->input('business_license_img'), //'营业执照',
                'personal_img' => $request->input('personal_img'),
                'shop_type' => $request->input('shop_type'),//'店铺类型 1-个体工商户',
                'shop_status' => 2,//'状态 1-正常。2-待审核。3异常',
                'shop_wechat' => $request->input('shop_wechat'),//'店铺微信号',
                'shop_qq' => $request->input('shop_qq'),
            ];

            Shop::createOne($data)->save();
            return makeResponse([], '创建成功', 200);
        } catch (\Exception $exception) {
            return makeResponse([], "[-FILE-]:" . $exception->getFile() . "[-LINE-]:" . $exception->getLine(),
                500);
        }
    }
}